package aop04;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

//异常通知
public class ServiceExceptionAdvice implements ThrowsAdvice {

//    public void afterThrowing(Exception e){
//        System.out.println("exception");
//    }
//
//    public void afterThrowing(SomeException e){
//        System.out.println("some exception");
//    }
//
//    public void afterThrowing(OtherException e){
//        System.out.println("other exception");
//    }

    public void afterThrowing(Method method, Object[] args, Object target, Exception e){
        System.out.println(target.getClass().getName()+"类"+method.getName()+"方法抛出了"+e+"异常");
    }
}
